package com.nimitz.modules.demo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.nimitz.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * @ClassName DemoUser
 * @Author Vincent
 * @Date 2021-08-19-15:04
 * @PackageName com.nimitz.modules.demo.domain
 * @Description 演示模块-用户表
 * @Version 1.0.0
 */
@TableName("demo_user")
@ApiModel(value = "DemoUser对象", description = "用户表")
public class DemoUser extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;

    /**
     * 部门id
     */
    @ApiModelProperty(value = "部门id")
    private Long departmentId;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    private String userName;

    /**
     * 年龄
     */
    @ApiModelProperty(value = "年龄")
    private int age;

    /**
     * 邮件
     */
    @ApiModelProperty(value = "邮件")
    private String mail;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @ApiModelProperty(value = "删除标志（0代表存在 2代表删除）")
    private String delFlag;

    /**
     * 部门对象
     */
    @TableField(exist = false)
    private DemoDepartment demoDepartment;

    /**
     * 角色对象集合
     */
    @TableField(exist = false)
    private List<DemoRole> demoRoles;

    /**
     * get与set方法
     */

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Long departmentId) {
        this.departmentId = departmentId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public DemoDepartment getDemoDepartment() {
        return demoDepartment;
    }

    public void setDemoDepartment(DemoDepartment demoDepartment) {
        this.demoDepartment = demoDepartment;
    }

    public List<DemoRole> getDemoRoles() {
        return demoRoles;
    }

    public void setDemoRoles(List<DemoRole> demoRoles) {
        this.demoRoles = demoRoles;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("userId", getUserId())
                .append("departmentId", getDepartmentId())
                .append("userName", getUserName())
                .append("age", getAge())
                .append("mail", getMail())
                .append("delFlag", getDelFlag())
                .toString();
    }
}
